import { SheetManager } from "../../ccc3-framework-core/framework/modules/sheetManager";
import { GameStoreBase } from "./Sheets"
export class GameStore extends GameStoreBase {
  //id索引
  public static get(id: any) {
    if ((this as any)[id]) return (this as any)[id];
    return SheetManager.get("GameStore", id, GameStore);
  }
  public static getAll(): GameStore[] {
    return SheetManager.getAllSheets("GameStore", GameStore);
  }
  public static getStoreByLevel(level: number): GameStore {
    var all = this.getAll();
    for (let i = 0; i < all.length; i++) {
      if (all[i].UnlockLevel == level + 1) {
        return all[i];
      }
    }
  }
}